<%--
  Created by IntelliJ IDEA.
  User: gg
  Date: 14-4-23
  Time: 下午3:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <div class="page-header">
            <h1>
                Form Elements
                <small>
                    <i class="icon-double-angle-right"></i>
                    Common form elements and layouts
                </small>
            </h1>
        </div>
        <!-- /.page-header -->
        <form class="form-horizontal validation-form" action="" method="post">
             <input type="hidden" name="id" value="${demo.id}"/>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="col-md-3 control-label no-padding-right" for="propStr"> propStr </label>
                        <div class="col-md-9">
                            <input type="text" id="propStr" name="propStr" class="col-md-5 required" value="${demo.propStr}"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="col-md-3 control-label no-padding-right" for="propInteger"> propInteger </label>

                        <div class="col-md-9">
                            <input type="text" id="propInteger" name="propInteger" class="col-md-5 digits" value="${demo.propInteger}"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="col-md-3 control-label no-padding-right" for="propLong"> propLong </label>

                        <div class="col-md-9">
                            <input type="text" id="propLong" name="propLong"  class="col-md-5 digits" value="${demo.propLong}"/>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="col-md-3 control-label no-padding-right" for="propDouble"> propDouble </label>

                        <div class="col-md-9">
                            <input type="text" id="propDouble" name="propDouble"  class="col-md-5 number" value="${demo.propDouble}"/>
                        </div>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="col-md-3 control-label no-padding-right"> propDate </label>
                            <div class="input-group col-md-4">
                                <input type="text"  name="propDate" class="col-md-6 form-control datepicker" value="${demo.propDate}" />
                                <span class="input-group-addon"><i class="icon-calendar"></i></span>
                            </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="form-group">
                        <label class="col-md-3 control-label no-padding-right" for="description">description</label>

                        <div class="col-md-9">
                            <textarea id="description" name="description" class="col-md-5 autosize-transition">${demo.description}</textarea>
                        </div>
                    </div>
                </div>
            </div>

            <div class="clearfix form-actions">
                <div class="col-md-offset-9 col-md-3">
                    <button class="btn btn-info submit_button" type="button" id="demo_submit_button">
                        <i class="icon-ok bigger-110"></i>
                        提交
                    </button>
                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="icon-undo bigger-110"></i>
                        重置
                    </button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>
<before_footer>
 <jsp:include page="../../common/script_form.jsp"></jsp:include>
</before_footer>
<footer>
    <script type="text/javascript">
        $(function () {
            $('.validation-form').validate({});
        })
        //demo_submit_button
        $('#demo_submit_button').click(function () {
            //保存表单
            var formObj = $(this).parents('form');
            if (!formObj.valid()) return false;
            $(this).attr('disabled', 'disabled');
            $.simpleAjax({url: '${ctx}/demo/save.do', data: formObj.serialize(), callback: function (data) {
                $.initAlert({message: data.message,callback:function(){
                    window.location.href='${ctx}/demo/index.do';
                }});
            }});
        })
    </script>
</footer>